﻿param($domainControllers)

foreach($domainController in $domainControllers)
{
    $messages=@("Can’t allocate Client API slot")
    $files=@("netlogon.log","netlogon.bak")
    
    $matches=@()

    foreach($message in $messages)
    {
        foreach($file in $files)
        {
            Write-Host "Checking for $message in \\$domainController\c$\windows\debug\$file"
            $matches+=Get-Content -Path "\\$domainController\c$\windows\debug\$file" | select-string $message    
        }
    }

    if($matches)
    {
        Write-Warning "Encountered error on $domainController"
    }
    else
    {
        Write-Host -ForegroundColor Green "No errors found on $domainController"
    }
}